<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<div class="t_bar">基本信息</div>
		
<table class="t_css" width="100%" border="0" cellpadding="0" id="table1" cellspacing="1">
	
	<tr class="li_2">
		<td   align="right" width="20%"><span class="color_red">*</span>项目名称：</td>
		<td  colspan="3">
			<input id="zh_title" name="proposal/zh_title" label="项目名称" type="text" class="input_css required"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<%-- <tr class="li_2">
		<td   align="right" width="20%">项目类别：</td>
		<td  colspan="3">
			<x:out select="$xmlData/data/proposal/sub_grant_name" /> 
		</td>
	</tr>
 --%>	
	 <tr class="li_1">
	<td  align="right" nowrap><span class="color_red">*</span>申报领域：</td>
	<td colspan="3">
	       <c:set var="statYear">${statYear}</c:set>
			 <c:if test="${empty statYear}">
			<c:set var="statYear"><x:out select="$xmlData/data/proposal/stat_year" /></c:set>
				</c:if>
			 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			 <%--
			<c:set var="domain_value"><x:out select="$xmlData/data/proposal/domain_value" /></c:set>
			<cpt:checkbox key="grant_domain" name="domain" repeatColumn="4"  sqlParamVal="{'grant_code':'${grantCode}'}"></cpt:checkbox>
			<input type="hidden" name="proposal/domain_value" class="required"  value="${domain_value}" label="申报领域">
			<input type="hidden" name="proposal/domain_name" value="<x:out select="$xmlData/data/proposal/domain_name" />"> --%>
			
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="domain">{'id':'<x:out select="$xmlData/data/proposal/domain_value" />','name':'<x:out select="$xmlData/data/proposal/domain_name" />'}</c:set>
          	<cpt:tree key="domain1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${domain}"  label="申报领域"
          		id="domain" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue3" sqlParamVal="{grant_code:	${sub},stat_year:${statYear}}"/>
	        <input id="domain_value" type="hidden" name="proposal/domain_value" class="required" label="申报领域" value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
            <input id="domain_name" type="hidden" name="proposal/domain_name"  value="<x:out select="$xmlData/data/proposal/domain_name" />"/>
	</td>
	</tr>
	
	<tr class="li_2"> 
	<td align="right"><span class="color_red">*</span>学科名称：</td>
   <td  colspan="3">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray inputWidth1" readonly="true" value="${subject}"  label="学科名称" 
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2"/>
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="学科名称" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
   </td>
	</tr>

	<tr class="li_1">
	<td  align="right" nowrap><span class="color_red">*</span>项目开始时间：</td>
		<td >
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="项目开始时间" ></cpt:date> 
		</td>
		<td  align="right" nowrap><span class="color_red">*</span>项目结束时间：</td>
		<td>
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="项目结束时间"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr class="li_2">
	    <td  align="right" nowrap width="20%"><span class="color_red">*</span>申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="申报日期"></cpt:date> 
		</td>
	</tr>
	</table>
	
 <table class="t_css" width="100%" border="0" cellpadding="0"   cellspacing="1" id="table2">
      <tr class="li_1">
          <td align="left"><span class="color_red">*</span><strong>1、科技扶贫示范村主要建设内容</strong>（限300字）</td>
      </tr>
      <tr class="li_2">
          <td>
			<textarea rows="7" cols="127"  class="input_textarea required  maxlength:300"   name='proposal/goal/summary1'  label="科技扶贫示范村主要建设内容"><x:out select="$xmlData/data/proposal/goal/summary1"/></textarea>
		   <input type='hidden' name='proposal/goal/summary1_hidden' id='proposal/goal/summary1_hidden' value=''>
		  </td>
      </tr>
      <tr class="li_1">
          <td align="left"><span class="color_red">*</span><strong>2、主要技术经济指标和贫困户增收情况</strong>（限200字）</td>
      </tr>
      <tr class="li_2">
          <td>
			<textarea rows="7" cols="127" name='proposal/goal/summary2' class="input_textarea required  maxlength:200"   label="主要技术经济指标和贫困户增收情况"><x:out select="$xmlData/data/proposal/goal/summary2"/></textarea>
	        <input type='hidden' name='proposal/goal/summary2_hidden' id='proposal/goal/summary2_hidden' value=''>
	      </td>
      </tr>
   </table>

<script type="text/javascript">

function cydw(id){
	var count =0 ;
	$("#"+id).find("input[type='text']").each(function(){
		if($.trim($(this).val()) != ''){
			count +=1;
		}
	});
	if(count != 0){
		$("#"+id).find("input[type='text']").each(function(){
			$(this).addClass("required");
		});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','');
		});
	}else{
		$("#"+id).find("input[type='text']").each(function(){
			$(this).removeClass("required");
	});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','none');
		});
	}
}

function setProjectPlace(op){
	var address = $("#address_value").val();
	if(op) address = '${address}';
	$("#address_name_other").removeClass("required");
	if(address == '02'){
		$("#address_name_other_span").show();
		$("#address_name_other").css("display","");
		$("#address_name_other").addClass("required");
	}else{
		$("#address_name_other_span").hide();
		$("#address_name_other").removeClass("required");
		$("#address_name_other").val("");
	}
}
function initTreeValue2CallBack(){
	cydw('org1');
	cydw('org2');
}
function setEmptyValueForTree(id){
	$("#"+id).val("");
	$("#"+id+"_hideId").val("");
	$("#"+id+"_hideName").val("");
	$("#"+id+"_code").val("");
	$("#"+id+"_value").val("");
	$("#"+id+"_name").val("");
	$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	$("#sqdm").val("");
	cydw('org1');
	cydw('org2');
}

</script>

